package com.hyt.it.ogt.pj.service.impl;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hyt.it.ogt.pj.mapper.BatchSubjectMapper;
import com.hyt.it.ogt.pj.model.entity.BatchSubject;
import com.hyt.it.ogt.pj.service.IBatchSubjectService;


/**
 * <p>
 * 评卷项目配置表 服务实现类
 * </p>
 *
 * @author liy
 * @since 2022-02-28
 */
@Service
public class BatchSubjectServiceImpl implements IBatchSubjectService {


    @Autowired
    private BatchSubjectMapper batchSubjectMapper;


    @Override
    public void saveBatchSubject(BatchSubject batchSubject) throws Exception {
        if(StringUtils.isEmpty(batchSubject.getId())){
            batchSubjectMapper.insert(batchSubject);
        }else{
            batchSubjectMapper.updateById(batchSubject);
        }

    }

    @Override
    public void delById(String id) throws Exception {
        batchSubjectMapper.deleteById(id);
    }
}
